package com.scott.ch030;

import redis.clients.jedis.Jedis;

import java.util.List;

/**
 * @author 黄后林
 * @version 1.0
 * @note  Redis String 批量设置
 * @date 2022-03-25 11:42:30
 */
public class RedisString {

    public static void main(String[] args) {
        Jedis jedis = new Jedis("192.168.88.129", 6379);

        //批量设值
        jedis.mset("hy","80","db","70","scott","90");

        //批量取值
        List<String> scores = jedis.mget("hy", "db", "scott");
        System.out.println(scores);

        //单个取值
        System.out.println(jedis.get("scott"));




        jedis.close();
    }
}
